package com.example.springcloudwinter;

import com.example.springcloudwinter.token.AuthenticationToken;
import com.example.springcloudwinter.token.JWTAuthenticationToken;
import com.example.springcloudwinter.token.JWTPropertiesInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableFeignClients
@EnableDiscoveryClient
public class UserApplication {
    public static void main (String[] args) {
        SpringApplication.run(UserApplication.class, args);
    }

    @Bean
    public AuthenticationToken getAuthenticationToken(@Autowired JWTPropertiesInterface jwtProperties){
        return new JWTAuthenticationToken(jwtProperties);
    }
}
